Space  Contents Previous Next


Variables in .idq and .htx Files

Read-Only Variables Available in .htx Files
Variables that Are Settable in Forms and in .idq Files
String Variables Useful for Formatting Displayed Columns
Parameter for Use with Bookmarks
Standard CGI Variables Available
Valid Locale Identifiers


To TopRead-Only Variables Available in .htx Files

The following variables are available for use in .htx files. These are set based upon the results of the search. In addition, the other IDQ variables mentioned below can be used in the .htx file. In the detail section of the .htx file, any output columns mentioned in the CiColumns can also be used.

Read-Only Variables Available in .htx Files:

Variable NameMeaning
CiBookmarkReference to the first row on the page.
CiContainsFirstRecordSet to 1 if this page contains the first record of the query results; 0 otherwise.
CiContainsLastRecord Set to 1 if this page contain the last record of the query results; 0 otherwise. For a sequential query, this will not be accurate until after the <%enddetail%> section in the .htx file.
CiCurrentPageNumberCurrent page number of query results (that is, page number x of y pages).
CiCurrentRecordNumberNumber displayed for current record.
CiErrorMessageError message. Available only for error pages. See the Error Messages page for possible error messages.
CiErrorNumberError number. Available only for error pages.
CiFirstRecordNumberRecord number of first record on a page.
CiLastRecordNumberLast record number on a page. For a sequential query, this will not be accurate until after the
<%enddetail%> section in the .htx file.
CiMatchedRecordCountTotal number of records matching a query. Referring to this variable from the .htx file will force the search to use a nonsequential query.
CiOutOfDateSet to 1 if the content index out of date; 0 otherwise.
CiQueryIncompleteSet to 1 if the query could not be resolved using the content index and CiForceUseCI was set; 0 otherwise.
CiQueryTimedOutSet to 1 if the query exceeded the time limit for execution; 0 otherwise.
CiQueryDateDate (at the Web server) the query was executed.
CiQueryTimeTime (at the Web server) the query was executed.
CiQueryTimeZoneTime zone of the Web server.
CiRecordsNextPageNumber of records on the next page. Referring to this variable from the .htx file will force the search to use a nonsequential query.
CiTotalNumberPagesTotal number of pages used to contain query results. Referring to this variable from the .htx file will force the search to use a nonsequential query.

To TopVariables that Are Settable in Forms and in .idq Files

Following is the set of variables that can be set in the .idq file or as CGI variables and referred to in the .htx file. They can also be set as variables in forms, or given as parameters to a direct execution of the .idq file.

Variable Name Meaning
CiCatalogOverride for the location of the catalog; defaults to the registry parameter if it is set, or to CiScope otherwise.
CiColumnsList of output columns available in the .htx file. Format is a series of columns named by friendly names and separated by commas. Up to 50 output columns can be referred to in a single query. Properties cannot be duplicated. Different friendly names for the same property are considered duplicates.
CiDeferNonIndexedTrimmingSome trimming of query results may be performed on individual objects after using the index to locate potential matches. Common post-processing includes trimming to match scope, and security. When a query sorted in descending order by rank is run, the full set of objects is examined to locate the CiMaxRecordsInResultSet top records. Because the top records cannot include items that fail post-index trimming, many thousands of items may have to be examined and thrown out to find the top results of a particular query, which can be very resource-intensive. Setting CiDeferNonIndexedTrimming to TRUE will first find the CiMaxRecordsInResultSet top records in the entire index, and then trim only that set. When this variable is set to TRUE, the number of results returned to the user may be less than CiMaxRecordsInResultSet, even if that many records match the query. The missing results will always be of lower rank than those returned. Although fewer results may be returned than expected, the best results will always be returned.

This flag should only be set when the scope of a query is set to the virtual root (CiScope = /) and there is a reasonable expectation that queries are pure content queries (no property value clause) and most results are accessible to the user. On a public Web site, this will be a common scenario.

CiFlagsQuery flags specifying the depth of search. DEEP means the directory given in CiScope and all directories below it, SHALLOW means only the directory specified in CiScope.
CiForceUseCiIf TRUE, query will be forced to use the content index, even if the content index is out of date.
CiLocaleDefines the locale used to issue the query. Standard HTML locale encoding is supported.
CiMaxRecordsInResultSetMaximum number of query results to return from a query.
CiMaxRecordsPerPage Maximum number of records to display on a page.
CiRestrictionQuery restriction, a description of what to search for. To display this on a page, or to use this in a URL with a query expression, see Syntax on the “HTML Extension File” page.
CiScopeScope, the starting directory for the search as either a virtual or physical path name. To use this in a URL with a query expression, see Syntax on the “HTML Extension File” page.
CiSortSort specification. Format is a series of columns named by friendly names and followed by either [a] for ascending order or [d] for descending order. The primary sort column is listed first, for example, CiSort=Rank[d], FileName[a]. Setting this variable may force the search to use a nonsequential query.
CiTemplateOutput template (.htx) file path name (as a virtual path name). This path name must be a complete path name from the virtual root with no “.” or “..” components.

To TopString Variables Useful for Formatting Displayed Columns

The variables below, like those in the table above, may be set in the .idq file, but they may not refer to other parameters. They cannot be referred to in the .htx file, but are used only to format columns whose type is a vector.

Variables for Formatting Columns with Vectors:

Variable Name Meaning
CiBoolVectorPrefixString printed prior to vectors of Boolean values
CiBoolVectorSeparatorString printed between elements of vectors of Boolean values
CiBoolVectorSuffixString printed after vectors of Boolean values
CiCurrencyVectorPrefixString printed prior to vectors of currency values
CiCurrencyVectorSeparatorString printed between elements of vectors of currency values
CiCurrencyVectorSuffixString printed after vectors of currency values
CiDateVectorPrefixString printed prior to vectors of dates
CiDateVectorSeparatorString printed between elements of vectors of dates
CiDateVectorSuffixString printed after vectors of dates
CiNumberVectorPrefixString printed prior to vectors of numbers
CiNumberVectorSeparatorString printed between elements of vectors of numbers
CiNumberVectorSuffixString printed after vectors of numbers
CiStringVectorPrefixString printed prior to vectors of strings
CiStringVectorSeparatorString printed between elements of vectors of strings
CiStringVectorSuffixString printed after vectors of strings

To TopParameter for Use with Bookmarks

The CiBookmarkSkipCount variable (described in the next table) is used in conjunction with CiBookmark to set an offset from the previous page of the query. It cannot be set in the .idq file; it should be set as a form variable. See Navigating Between Pages in Query Results on the “HTML Extension Files” page for examples.

The following variable can be set as a CGI variable, for navigating between pages:

Variable Name Meaning
CiBookmarkSkipCountSigned number of rows to skip for the next page. Negative means skip backward, positive means skip forward.

To TopStandard CGI Variables Available

The variables below are normally set by CGI program execution and can be referred to in the .idq or .htx files.

Variables Available from CGI Parameters:

HTTP Variable Meaning
ALL_HTTPAll HTTP headers that were not already parsed into one of the listed variables. These variables are of the form HTTP_header field name with each variable separated by \r\n, for example:
HTTP_ACCEPT: */*, q=0.300, audio/x-aiff, audio/basic, image/jpeg, image/gif, text/plain, text/html
HTTP_USER_AGENT: Microsoft Internet Explorer/0.1 (Win32)
HTTP_REFERER: http://webserver/samples/dbsamp/dbsamp3.htm
HTTP_CONTENT_TYPE: application/x-www-form-urlenPRE: 10
HTTP_EXTENSION: Security/Digest
AUTH_TYPE The type of authorization in use. If the user name has been authenticated by the server, this will contain Basic. Otherwise, it will not be present.
CONTENT_LENGTHThe number of bytes that the script can expect to receive from the client.
CONTENT_TYPEThe content type of the information supplied in the body of a POST request.
GATEWAY_INTERFACEThe revision of the CGI (Common Gateway Interface) specification with which this server complies. The current version is CGI/1.1.
HTTP_ACCEPTSpecial-case HTTP header. Values of the Accept: fields are concatenated, separated by “,”; for example, if the following lines are part of the HTTP header: accept: */*; q=0.1 accept: text/html accept: image/jpeg then the HTTP_ACCEPT variable will have a value of: */*; q=0.1, text/html, image/jpeg.
PATH_INFOAdditional path information, as given by the client. This comprises the trailing part of the URL after the script name but before the query string (if any).
PATH_TRANSLATEDThis is the value of PATH_INFO, but with any virtual path name expanded into a directory specification.
QUERY_STRINGThe information which follows the question mark (?) in the URL that referenced this script.
REMOTE_ADDRThe IP address of the client.
REMOTE_HOSTThe hostname of the client.
REMOTE_USERThis contains the user name supplied by the client and authenticated by the server.
REQUEST_METHOD The HTTP request method.
SCRIPT_NAMEThe name of the script program being run.
SERVER_NAMEThe server’s hostname (or IP address) as it should appear in self-referencing URLs.
SERVER_PORTThe TCP/IP port on which the request was received.
SERVER_PROTOCOLThe name and version of the information-retrieval protocol relating to this request, usually HTTP/1.0.
SERVER_SOFTWAREThe name and version of the Web server under which the Internet Server Extension is running.

To TopValid Locale Identifiers

Valid Locale Identifiers for Use in CiLocale:

LanguageCiLocale StringWin32 Equivalent
ChineseZH, ZH-CN, ZH-TWLANG_CHINESE | SUBLANG_CHINESE_SIMPLIFIED
BulgarianBGLANG_BULGARIAN | SUBLANG_DEFAULT
CroatianHRLANG_CROATIAN | SUBLANG_DEFAULT
CzechCSLANG_CZECH | SUBLANG_DEFAULT
DanishDALANG_DANISH | SUBLANG_DEFAULT
DutchNLLANG_DUTCH | SUBLANG_DUTCH
English (Great Britain)EN-GBLANG_ENGLISH | SUBLANG_ENGLISH_UK
English (US)EN, EN-USLANG_ENGLISH | SUBLANG_ENGLISH_US
FinnishFILANG_FINNISH | SUBLANG_DEFAULT
FrenchFR, FR-FRLANG_FRENCH | SUBLANG_FRENCH
French (Canadian)FR-CALANG_FRENCH | SUBLANG_FRENCH_CANADIAN
GermanDELANG_GERMAN | SUBLANG_GERMAN
GreekELLANG_GREEK | SUBLANG_DEFAULT
IcelandicISLANG_ICELANDIC | SUBLANG_DEFAULT
ItalianITLANG_ITALIAN | SUBLANG_ITALIAN
JapaneseJALANG_JAPANESE | SUBLANG_DEFAULT
KoreanKOLANG_KOREAN | SUBLANG_DEFAULT
Neutral (use built-in word breaking)NEUTRALLANG_NEUTRAL | SUBLANG_NEUTRAL
NorwegianNOLANG_NORWEGIAN | SUBLANG_DEFAULT
PolishPLLANG_POLISH | SUBLANG_DEFAULT
PortuguesePTLANG_PORTUGUESE | SUBLANG_DEFAULT
Portuguese (Brazilian)PT-BRLANG_PORTUGUESE | SUBLANG_PORTUGUESE_BRAZILIAN
RomanianROLANG_ROMANIAN | SUBLANG_DEFAULT
RussianRULANG_RUSSIAN | SUBLANG_DEFAULT
SlovakSKLANG_SLOVAK | SUBLANG_DEFAULT
SlovenianSLLANG_SLOVENIAN | SUBLANG_DEFAULT
SpanishES, ES-ESLANG_SPANISH | SUBLANG_SPANISH
SwedishSVLANG_SWEDISH | SUBLANG_DEFAULT
TurkishTRLANG_TURKISH | SUBLANG_DEFAULT

CiLocale can be specified in the .idq or .ida file. It can also be specified by the browser as the HTTP_ACCEPT_LANGUAGE tag. Values entered in the .idq and .ida files supersede those sent in HTTP_ACCEPT_LANGUAGE. If no value is found in the .idq or .ida file, the value of HTTP_ACCEPT_LANGUAGE is parsed from left to right to find a supported language.

For example:

HTTP_ACCEPT_LANGUAGE=EN, FR, CZ

Note   Values are separated by commas.


 Contents Previous Top Next


© 1996 by Microsoft Corporation. All rights reserved.